﻿using System.ComponentModel;
using System.Windows.Forms;

namespace WenSkin.Controls
{
    public class TreeDataGridViewRowNode
    {
        private TreeDataGridViewRowNodeCollection nodes;
        private readonly DataGridView owner;
        public TreeDataGridViewRowNode(DataGridView owner)
        {
            this.owner = owner;
        }
        public DataGridView DataGridView => owner;

        [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
        [Category("Wen")]
        [Description("当前单元格所在级别")]
        public int Level { get; set; }

        [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
        [Category("Wen")]
        [Description("当前单元格内容")]
        public DataGridViewRow DataGridViewRow { get; set; }

        [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
        [Category("Wen")]
        [Description("父级单元格内容")]
        public DataGridViewRow ParentLevel { get; set; }

        [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
        [Category("Wen")]
        [Description("子级数据集合")]
        public TreeDataGridViewRowNodeCollection Nodes => nodes ??= new TreeDataGridViewRowNodeCollection();
    }
}
